package com.pactera.bledemo.activity.traditional

import android.Manifest
import android.content.Intent
import android.os.Bundle
import android.view.View
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.dylanc.viewbinding.nonreflection.binding//不使用反射，注意此包不提示导入，需要手动导入
import com.pactera.bledemo.databinding.ActivityTraditionalBinding
import com.permissionx.guolindev.PermissionX

/**
 * 传统蓝牙示例
 */
class TraditionalActivity : AppCompatActivity() {
    // private val binding: ActivityMainBinding by binding()  //使用反射
    private val binding by binding(ActivityTraditionalBinding::inflate)//不使用反射

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding.apply {
            actionToolbar.tvTitle.text = "传统蓝牙"
            actionToolbar.imgBack.setOnClickListener { finish() }
        }
        binding.apply {
            baseButton.setOnClickListener {
                startActivity(Intent(this@TraditionalActivity, BaseBlueToothActivity::class.java))
            }
            startClientBtn.setOnClickListener {
                startActivity(Intent(this@TraditionalActivity, ClientActivity::class.java))
            }
            startServerBtn.setOnClickListener {
                startActivity(Intent(this@TraditionalActivity, ServerActivity::class.java))
            }
        }
    }

}